﻿<Window x:Class="SqlAServer.TableDialog"
        xmlns:local="clr-namespace:SqlAServer"            
        xmlns:core="clr-namespace:sqCore;assembly=sqCore"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="TableDialog" Height="300" Width="738">
    <Window.Resources>
        <core:ArrayToStringConverter x:Key="ArrayToStringConverter"/>
        <core:TimeToLocalTimeCoverter x:Key="TimeToLocalTimeCoverter"/>
    </Window.Resources>
    <Grid>
        <DataGrid x:Name="Table" ItemsSource="{Binding logsView}" AutoGenerateColumns="False" Margin="0,20,-1,2" SelectionChanged="Table_SelectionChanged" IsTextSearchEnabled="True" EnableColumnVirtualization="True" IsManipulationEnabled="True" MouseLeftButtonDown="Table_MouseLeftButtonDown" MouseDoubleClick="Table_MouseDoubleClick" SelectionUnit="Cell" AreRowDetailsFrozen="True" IsReadOnly="True">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Time" Binding="{Binding Time, Converter={StaticResource TimeToLocalTimeCoverter}}"/>
                <DataGridTextColumn Header="Message" Binding="{Binding LogMessage}" Width="*"/>
                <DataGridTextColumn Header="Pasrams" Binding="{Binding Params, Converter={StaticResource ArrayToStringConverter} }"  Width="*"/>
            </DataGrid.Columns>
        </DataGrid>


    </Grid>
</Window>
